package com.gf.pokemon.constants;

import com.gf.pokemon.platform.exception.PokeErrorCode;
import com.gf.pokemon.platform.exception.PokeException;

public enum VoteStatus {
	voting(0),
	finish(1);
	private Integer type;
	
	private VoteStatus(Integer type){
		this.type = type;
	}
	
	public Integer getType(){
		return type;
	}
	
	public static VoteStatus parse(Integer type) throws PokeException{
		for(VoteStatus voteStatus:VoteStatus.values()){
			if(voteStatus.getType().equals(type)){
				return voteStatus;
			}
		}
		throw new PokeException(PokeErrorCode.INVALID_PARAM,"投票状态错误，目前仅支持0投票中和1投票完成");
	}
}
